package HeSuanServer.controller;

import HeSuanServer.uitl.DrawCheckcode;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @描述:
 * @author: LH
 * @date: 2023/2/7
 */
@RestController
@RequestMapping("test")
public class testController {
    @GetMapping("imgCode")
    public void image(HttpServletResponse response) throws IOException {
        ImageIO.write(new DrawCheckcode().doDraw(),"JPG",response.getOutputStream());
    }
}
